﻿using T0yK4T.IO;

namespace ToyChat.Client
{
    /// <summary>
    /// This interface describes a single point of authentication for clients
    /// </summary>
    public interface IAuthenticationModule
    {
        /// <summary>
        /// Attempts to authenticate on the server using the specified <see cref="IConnectionSettings"/>
        /// </summary>
        /// <param name="connection">The <see cref="CryptoConnection"/> that should be used to send and receive packets</param>
        /// <param name="settings">The <see cref="IConnectionSettings"/> to use for authentication purposes</param>
        /// <param name="client">The client that was used to initiate the connection and expects an <see cref="IClient.OnAuthenticated"/> call</param>
        /// <returns>True if succesful, otherwise false</returns>
        bool Authenticate(CryptoConnection connection, IConnectionSettings settings, IClient client);
    }
}